<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Index extends MY_Controller {

    public function __construct()
    {
        parent::__construct();
        //Load model
        $this->load->model('blog_m');
    }

    /**
     * Default function
     */
    public function index()
    {
        //Set layout homepage
        $this->set_layout('frontend/homepage');
        
        //Set params
        $newsId = $this->config->item('NEWS_ID');
        
        //Get data
        $arrNews = $this->blog_m->get_top_object_by_cateId($newsId, 3, 0);
        
        //Assign to view
        $this->assign('arrNews', $arrNews);
    }

}